import request from '@/config/axios'
import { url } from 'inspector'

// 套餐种类 VO
export interface CategoryVO {
  id: number // 主键ID
  name: string // 套餐种类名称
  picUrl: string // 展示图片
  description: string // 描述
  status: number // 状态
  sort: number // 排序
}

// 套餐种类 API
export const CategoryApi = {
  // 查询套餐种类分页
  getCategoryPage: async (params: any) => {
    return await request.get({ url: `/package/category/page`, params })
  },

  // 查询套餐种类详情
  getCategory: async (id: number) => {
    return await request.get({ url: `/package/category/get?id=` + id })
  },

  // 新增套餐种类
  createCategory: async (data: CategoryVO) => {
    return await request.post({ url: `/package/category/create`, data })
  },

  // 修改套餐种类
  updateCategory: async (data: CategoryVO) => {
    return await request.put({ url: `/package/category/update`, data })
  },

  // 删除套餐种类
  deleteCategory: async (id: number) => {
    return await request.delete({ url: `/package/category/delete?id=` + id })
  },

  // 导出套餐种类 Excel
  exportCategory: async (params) => {
    return await request.download({ url: `/package/category/export-excel`, params })
  },

  // 获取套餐种类列表
  getPackageCategoryList: async () => {
    return await request.get({ url: `/package/category/list`})
  }
}